<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>广告管理列表</title>
<script type="text/javascript" src="js/jquery-1.12.4.min.js"
	th:src="@{/js/jquery-1.12.4.min.js}"></script>
<link href="bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet"
	th:href="@{/bootstrap-3.3.7-dist/css/bootstrap.min.css}">
<script src="bootstrap-3.3.7-dist/js/bootstrap.min.js"
	th:src="@{/bootstrap-3.3.7-dist/js/bootstrap.min.js}"></script>
<script type="text/javascript">
	$(function() {

	})

	function page(n) {
		$("#pageNo").val(n);
		$("#searchForm").submit();
		return false;
	}
</script>
</head>
<body>
	<div class="container-fluid">
		<br>
		<form id="searchForm" action="/admin/admin/cms/adHref/" method="post"
			class="form-horizontal">
			<input id="pageNo" name="pageNo" type="hidden"
				th:value="${pageInfo.pageNum}" />
			<div class="form-group">
				<label for="firstname" class="col-sm-1 control-label">名称：</label>
				<div class="col-sm-2">
					<input name="name" class="form-control input-sm" placeholder="名称"
						th:value="${adHref.name}" />
				</div>
				<label for="firstname" class="col-sm-1 control-label">类型：</label>
				<div class="col-sm-2">
					<input name="type" class="form-control input-sm" placeholder="类型"
						th:value="${adHref.type}" />
				</div>
				<label for="firstname" class="col-sm-1 control-label">状态：</label>
				<div class="col-sm-2">
					<input name="status" class="form-control input-sm" placeholder="状态"
						th:value="${adHref.status}" />
				</div>
				<button class="btn btn-success btn-sm" type="submit">
					<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
					查询
				</button>
				<a th:href="@{/admin/cms/adHref/form}" class="btn btn-info btn-sm"
					target="mainFrame">新增</a>
			</div>
		</form>
		<div class="alert alert-info alert-dismissible" role="alert"
			th:if="${msg!=null}">
			<button type="button" class="close" data-dismiss="alert"
				aria-label="Close">
				<span aria-hidden="true">&times;</span>
			</button>
			<strong>提示!</strong><span th:text="${msg}"></span>
		</div>
		<table id="contentTable"
			class="table table-striped table-bordered table-condensed">
			<thead>
				<tr>
					<th>序号</th>
					<th>图片</th>
					<th>名称</th>
					<th>类型</th>
					<th>状态</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<tr th:each="adHref,index_no:${pageInfo.list}">
					<td>[[${index_no.index+1+(pageInfo.pageNum-1)*pageInfo.pageSize
						}]]</td>
					<td><img th:src="${adHref.pic}"
						style="width: 100px; height: 80px;"></td>
					<td>[[${adHref.name}]]</td>
					<td>
						<span th:if="${adHref.type=='1'}" style="color: red;">首页轮播</span>
						<span th:if="${adHref.type=='2'}" style="color: green;">友情链接</span>
						<span th:if="${adHref.type=='3'}" style="color: blue;">推文广告</span>
					</td>
					<td>
						<span th:if="${adHref.status=='1'}" style="color: blue;">正常</span>
						<span th:if="${adHref.status=='2'}" style="color: red;">停用</span>
					</td>
					<td><a th:href="@{/admin/cms/adHref/form?id=}+${adHref.id}"
						href="#">
							<button class="btn btn-primary btn-xs">
								<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
								编辑
							</button>
					</a> <a th:href="@{/admin/cms/adHref/delete?id=}+${adHref.id}" href="#"
						onclick="return confirm('确认要删除吗？', this.href)">
							<button class="btn btn-danger btn-xs">
								<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
								删除
							</button>
					</a></td>
				</tr>
			</tbody>
		</table>

		<!-- 分页条 -->
		<div class="row" th:include="model :: pageInfo"></div>
	</div>
</body>
</html>